package cn.tedu.hotelApi.evaluate.controller;

import cn.tedu.hotelApi.base.response.JsonResult;
import cn.tedu.hotelApi.evaluate.pojo.entity.Evaluate;
import cn.tedu.hotelApi.evaluate.service.EvaluateService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController()
@RequestMapping(value = "/v1/evaluate/")
@Slf4j
@Api(tags = "评论模块")
@Validated
public class EvaluateController {

    @Autowired
    private EvaluateService evaluateService;
    @GetMapping("select")
    public JsonResult selectEvaluate(Evaluate evaluate){
        log.debug("查询评论:userQuery={}",evaluate);
        List<Evaluate> list = EvaluateService.selectEvaluate(evaluate);
        return JsonResult.ok(list);
    }
}
